/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jbrowser.session;

import java.net.URI;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author buczko
 */
public class ClassPathSessionFactory implements SessionFactory {

    ClassPathSession classPathSession = new ClassPathSession();

    @Override
    public Session getSession(URI uri) {
        try {
            if (uri.getScheme() == null || uri.getScheme().equals("jbrowser")) {
                return classPathSession;
            } else {
                return null;
            }
        } catch (Exception ex) {
            Logger.getLogger(ClassPathSessionFactory.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public boolean supports(String protocol) {
        return protocol == null || protocol.equals("jbrowser");
    }
}
